
import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main, sim_items
from util import *

class Potion(sim_items.Potion):
    def __init__(self):
        sim_items.Potion.__init__(self, "myopia", "!",
                ('see', 'less'),
                idDescription="Ophthomologically speaking, this potion "\
                    "induces nearsightedness and makes things in the "\
                    "distance hard to see. It was alchemically devised as a "\
                    "corrective for those who are farsighted and work in "\
                    "environments that make lenses impractical.")

    def quaff(self, quaffer):
        self.amount = random.randint(2,8)
        self.duration = 30000

        main.schedule(sim.Event('decrease stat', main.schedule.time, (quaffer,
            'perceptionMod', self.amount), dests=[quaffer]))
        main.schedule(sim.Event('increase stat', main.schedule.time +\
            self.duration, (quaffer, 'perceptionMod', self.amount), dests=[quaffer]))
        main.schedule(sim.Event('statusNote+', main.schedule.time, (quaffer,
            'myopia'), dests=[quaffer]))
        main.schedule(sim.Event('statusNote-', main.schedule.time +\
            self.duration, (quaffer, 'myopia'), dests=[quaffer]))
        quaffer.identify(self)

#========================================
thingClass = Potion





